std::basic_string::size

From Cppreference

Jump to: navigation, search
​size_type size() const;

Returns the number of characters in the string, i.e. ​std::distance(begin(), end()). It is the same as length().

Contents

Parameters

(none)

Return value

the number of characters in the string

Complexity

constant

See also

empty
checks whether the string is empty
(public member function)
length
returns the length of the string
(public member function)
max_size
returns the maximum number of characters
(public member function)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
In other languages